import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;

public class test {
    public static void main(String[] args) {

        ArrayList<String>color=new ArrayList<String>();
        color.add("♠");
        color.add("♥");
        color.add("♦");
        color.add("♣");

        ArrayList<String>number=new ArrayList<String>();
        for (int i=3;i<=10;i++){
            number.add(i+" ");
        }
        number.add("J");
        number.add("Q");
        number.add("K");
        number.add("A");
        number.add("2");

        HashMap<Integer,String>map=new HashMap<Integer,String>();
        int index = 0;
        for (String thisnumber:number){
            for (String thiscolor:color){
                map.put(index++,thiscolor+thisnumber);
            }
        }
        map.put(index++, "小☺");
        map.put(index++, "大☻");
        ArrayList<Integer>cards=new ArrayList<Integer>();
        for (int i=0;i<=53;i++){
            cards.add(i);
        }
        Collections.shuffle(cards);

        ArrayList<Integer>iplayer=new ArrayList<Integer>();
        ArrayList<Integer>iplayer2=new ArrayList<Integer>();
        ArrayList<Integer>iplayer3=new ArrayList<Integer>();
        ArrayList<Integer>iSecretCards=new ArrayList<Integer>();

        for (int i=0;i<cards.size();i++){
            if (i>=51){
                iSecretCards.add(cards.get(i));
            }else {
                if (i%3==0){
                    iplayer.add(cards.get(i));
                }else if(i%3==1){
                    iplayer2.add(cards.get(i));

                }else {
                    iplayer3.add(cards.get(i));

                }
            }
        }
        Collections.sort(iplayer);
        Collections.sort(iplayer2);
        Collections.sort(iplayer3);

        ArrayList<String>sPlayer=new ArrayList<String>();
        ArrayList<String>sPlayer2=new ArrayList<String>();
        ArrayList<String>sPlayer3=new ArrayList<String>();
        ArrayList<String>sSecretCards=new ArrayList<String>();

        for (Integer key:iplayer){
            sPlayer.add(map.get(key));
        }

        for (Integer key:iplayer2){
            sPlayer2.add(map.get(key));
        }

        for (Integer key:iplayer3){
            sPlayer3.add(map.get(key));
        }

        for (Integer key:iSecretCards){
            sSecretCards.add(map.get(key));
        }

        System.out.println("玩家1："+sPlayer);
        System.out.println("玩家2："+sPlayer2);
        System.out.println("玩家3："+sPlayer3);
        System.out.println("底牌："+sSecretCards);
    }
}
